# Maintainer: Orhun Parmaksız <orhun@archlinux.org>

pkgname=cargo2junit
pkgver=0.1.13
pkgrel=1
pkgdesc="Convert Cargo's JSON output to JUnit XML"
url='https://github.com/johnterickson/cargo2junit'
license=('MIT')
arch=('loong64' 'x86_64')
depends=('gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('647c41ce7416421f41dee298a6fb99ad8be7c584c7c16c1a7926720eb9777376')

prepare() {
	cd "$pkgname-$pkgver"
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$pkgname-$pkgver"
	cargo build --release --frozen
}

check() {
	cd "$pkgname-$pkgver"
	cargo test --frozen
}

package() {
	cd "$pkgname-$pkgver"
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim:set ts=2 sw=2 et:
